﻿using System;
using System.Collections.Generic;
using System.Text;

namespace UMS.Essences
{
    public class User:IUMSAbonent
    {
        public UIN Number
        {
            get { return num; }
            
        }
        UIN num;
        public string Password { get; set; }

        public string Name
        {
            get;
            set;
        }
        public List<Connection> Connections
        {
            get;
            set;
        }
        List<Contact> Contacts { get; set; }

        public User()
        {
            num = UIN.NewUIN();
        }
        public User(UIN u)
        {
            num = u;
        }

        public static User()
        {
            try
            {
                UIN u = new UIN(Properties.Settings.Default.User);
                Current = new User(u);
                Current.Password = Properties.Settings.Default.UserPswd;
            }
            catch (ArgumentException)
            {
                Current = null;
            }
        }

        public static User Current;
    }
}
